<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:common="http://java.sun.com/jsf/composite/common">
<h:body>
	<ui:composition template="/pages/templates/MainTemplate.xhtml">
		<ui:define name="content">
			<div>
				<h3>Maquinas</h3>
			</div>
			<h:form id="abmForm" styleClass="tableNoGrid">
				<p:messages id="addMessages" showDetail="true" globalOnly="true"></p:messages>
				<p:panelGrid columns="1" style="width: 100%; table-layout: fixed;">
					<p:row>
						<p:column>
							<common:CRUDMenuBar id="maqMenuBar" crudManagedBean="#{maqMB}">
							</common:CRUDMenuBar>
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<common:maquinas id="maquinas" />
						</p:column>
					</p:row>
				</p:panelGrid>

				<h:panelGroup layout="block" id="abm_id">
					<h:panelGroup rendered="#{maqMB.showAbm}">
						<hr></hr>
						<common:maquinaForm id="maquinasForm" maquina="#{maqMB.newMaquina}">
						</common:maquinaForm>
						<p:panelGrid style="margin-top: 15px;">
							<p:row>
								<p:column>
									<p:commandButton value="Guardar"
										update=":abmForm:abm_id :abmForm:maquinas"
										actionListener="#{maqMB.save}" style="margin-right: 15px;">
									</p:commandButton>
									<p:commandButton value="Cancelar" update=":abmForm:abm_id"  actionListener="#{maqMB.reset}" process="@this">
									</p:commandButton>
								</p:column>
							</p:row>
						</p:panelGrid>
					</h:panelGroup>
				</h:panelGroup>


			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>